allnum=[int(i) for i in input().split()]
people,time=[int(i) for i in input().split()]
allnum=set(allnum)
status=[]
# 一行一个人，一列回合
for row in range(people):
    lget=[int(i) for i in input().split()]
    status.append(lget)

winner=[False,]+[True]*people
for col in range(time): # 列 轮数
    for row in range(people): # 行 总人数
        if status[row][col]==0: #不再处理被清除数据的已出局玩家
            continue
        out=1
        if status[row][col] not in allnum:
            # 这个循环计算量太大了，可能引起超时
            for i in allnum: # set无序不影响循环
                if i +status[row][col] in allnum:
                    out=0
                    # allnum.append(status[row][col]) 
                    allnum.add(status[row][col]) #set查找效率远高于list
                    break
            else:
                out=1

        if out==1:
            print("Round #%s: %s is out"%(col+1,row+1))
            status[row][col:]=[0]*(time-col)
            winner[row+1]=False

ans=[k for k,v in enumerate(winner)if v]  #NOTE 风格规范，不要写这种==True
if ans:
    print("Winner(s):",end="")
    print(*ans,sep=' ')
else:
    print("No winner")



